/**
 * PageMarket
 * MessageAction.java
 * com.android.pagemarket.io.protocol.in
 * 
 */
package com.android.pagemarket.io.protocol.in;

import com.android.pagemarket.business.model.Message;
import com.android.pagemarket.io.protocol.out.MessageList;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-11-13
 * @see : 快讯与促销接口
 * @Copyright : copyrights reserved by personal 2007-2012
 **********************************************************/
public class MessageAction extends HttpAction<MessageList>
{
    
    private int type;
    //  newNo   是   N   快讯编号
    //  pageNum 是   N   页数（默认10）
    public MessageAction(int newNo, int pageNum, int type)
    {
        super(type == Message.TYPE_PROMOT ? "9" : "8");
        addJsonParam("newNo", newNo);
        addJsonParam("pageNum", pageNum);
        this.type = type;
    }
    
    @Override
    protected MessageList parseJson(String response) throws Exception
    {
        MessageList one = new MessageList(type);
        one.parseResult(response);
        return one;
    }
}
